/*
 * @Description: 
 * @Version: 1.0
 * @Autor: lairensi
 * @Date: 2021-08-31 12:19:54
 * @LastEditors: lairensi
 * @LastEditTime: 2021-08-31 12:23:45
 */
import 'package:flutter_demo/util/dio.dart';


class HomeService {
  // 获取是否可以接班
  static getUserDutySchedulingNum(userId) async {
    var result = await DioUtils.request(
      "/ops/location/getUserDutySchedulingNum/$userId",
      method: DioUtils.GET,
    );
    return result;
  }

  // 获取是否可以接班
  static userDuty(Map params) async {
    var result = await DioUtils.request(
        "/ops/location/userDuty/${params['userId']}",
        method: DioUtils.POST,
        data: params);
    return result;
  }

  // 上传定位信息
  static setUserLocation(Map params) async {
    var result = await DioUtils.request(
        "/ops/location/setUserLocation/${params['userId']}",
        method: DioUtils.POST,
        data: params);
    return result;
  }

  // 查询工作任务数
  static listInspectTask(params) async {
    var result = await DioUtils.get(
      '/ops/inspect/listInspectTask/${params['userId']}',
      data: params,
    );
    return result;
  }

  // 获取系统版本号
  static appVersion() async {
    var result = await DioUtils.get(
      '/admin/appVersion/list',
      data: {
        'current': 1,
        'size': 1,
        'appType': 1,
      },
    );
    return result;
  }

  // 极光推送
  // userId 设备id
  // system Android或Ios
  static setUserJGId(params) async {
    var result = await DioUtils.get(
      '/ops/location/setUserJGId/${params['userId']}',
      data: params,
    );
    return result;
  }
}
